home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / lisp / blt1.000 / blt1 / blt-1.7-for-STk / configure < prev    next >
Encoding:
Text File  |  1994-07-25  |  9.5 KB  |  377 lines

  1.  
  2. #!/bin/sh
  3. # Guess values for system-dependent variables and create Makefiles.
  4. # Generated automatically using autoconf.
  5. # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  6.  
  7. # This program is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 2, or (at your option)
  10. # any later version.
  11.  
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. # GNU General Public License for more details.
  16.  
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program; if not, write to the Free Software
  19. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  
  21. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp]
  22. #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE[=VALUE]]
  23. # Ignores all args except --srcdir, --prefix, --exec-prefix, and
  24. # --with-PACKAGE[=VALUE] unless this script has special code to handle it.
  25.  
  26. for arg
  27. do
  28.   # Handle --exec-prefix with a space before the argument.
  29.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  30.   # Handle --host with a space before the argument.
  31.   elif test x$next_host = xyes; then next_host=
  32.   # Handle --prefix with a space before the argument.
  33.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  34.   # Handle --srcdir with a space before the argument.
  35.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  36.   else
  37.     case $arg in
  38.      # For backward compatibility, recognize -exec-prefix and --exec_prefix.
  39.      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  40.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  41.      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  42.     next_exec_prefix=yes ;;
  43.  
  44.      -gas | --gas | --ga | --g) ;;
  45.  
  46.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  47.      -host | --host | --hos | --ho | --h)
  48.     next_host=yes ;;
  49.  
  50.      -nfp | --nfp | --nf) ;;
  51.  
  52.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  53.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  54.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  55.     next_prefix=yes ;;
  56.  
  57.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  58.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  59.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  60.     next_srcdir=yes ;;
  61.  
  62.      -with-* | --with-*)
  63.        package=`echo $arg|sed -e 's/-*with-//' -e 's/=.*//'`
  64.        # Reject names that aren't valid shell variable names.
  65.        if test -n "`echo $package| sed 's/[-a-zA-Z0-9_]//g'`"; then
  66.          echo "configure: $package: invalid package name" >&2; exit 1
  67.        fi
  68.        package=`echo $package| sed 's/-/_/g'`
  69.        case "$arg" in
  70.          *=*) val="`echo $arg|sed 's/[^=]*=//'`" ;;
  71.          *) val=1 ;;
  72.        esac
  73.        eval "with_$package='$val'" ;;
  74.  
  75.      -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
  76.        verbose=yes ;;
  77.  
  78.      *) ;;
  79.     esac
  80.   fi
  81. done
  82.  
  83. trap 'rm -fr conftest* confdefs* core; exit 1' 1 3 15
  84. trap 'rm -f confdefs*' 0
  85.  
  86. # NLS nuisances.
  87. # These must not be set unconditionally because not all systems understand
  88. # e.g. LANG=C (notably SCO).
  89. if test "${LC_ALL+set}" = 'set' ; then LC_ALL=C; export LC_ALL; fi
  90. if test "${LANG+set}"   = 'set' ; then LANG=C;   export LANG;   fi
  91.  
  92. rm -f conftest* confdefs.h
  93. # AIX cpp loses on an empty file, so make sure it contains at least a newline.
  94. echo > confdefs.h
  95. compile='${CC-cc} $CFLAGS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  96.  
  97. # A filename unique to this package, relative to the directory that
  98. # configure is in, which we can look for to find out if srcdir is correct.
  99. unique_file=blt.c
  100.  
  101. # Find the source files, if location was not specified.
  102. if test -z "$srcdir"; then
  103.   srcdirdefaulted=yes
  104.   # Try the directory containing this script, then `..'.
  105.   prog=$0
  106.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  107.   test "X$confdir" = "X$prog" && confdir=.
  108.   srcdir=$confdir
  109.   if test ! -r $srcdir/$unique_file; then
  110.     srcdir=..
  111.   fi
  112. fi
  113. if test ! -r $srcdir/$unique_file; then
  114.   if test x$srcdirdefaulted = xyes; then
  115.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  116.   else
  117.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  118.   fi
  119.   exit 1
  120. fi
  121. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  122. # But we can't avoid them for `..', to make subdirectories work.
  123. case $srcdir in
  124.   .|/*|~*) ;;
  125.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  126. esac
  127.  
  128.  
  129. # Save the original args to write them into config.status later.
  130. configure_args="$*"
  131.  
  132. for hdr in unistd.h
  133. do
  134. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  135. echo checking for ${hdr}
  136. echo checking how to run the C preprocessor
  137. if test -z "$CPP"; then
  138.   # This must be in double quotes, not single quotes, because CPP may get
  139.   # substituted into the Makefile and ``${CC-cc}'' will simply confuse
  140.   # make.  It must be expanded now.
  141.   CPP="${CC-cc} -E"
  142.   cat > conftest.c <<EOF
  143. #include "confdefs.h"
  144. #include <stdio.h>
  145. Syntax Error
  146. EOF
  147. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  148. if test -z "$err"; then
  149.   :
  150. else
  151.   rm -rf conftest*
  152.   CPP=/lib/cpp
  153. fi
  154. rm -f conftest*
  155. fi
  156. test ".${verbose}" != "." && echo "    setting CPP to $CPP"
  157.  
  158. cat > conftest.c <<EOF
  159. #include "confdefs.h"
  160. #include <${hdr}>
  161. EOF
  162. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  163. if test -z "$err"; then
  164.   rm -rf conftest*
  165.   
  166. {
  167. test -n "$verbose" && \
  168. echo "    defining ${trhdr}"
  169. echo "#define" ${trhdr} 1 >> confdefs.h
  170. DEFS="$DEFS -D${trhdr}=1"
  171. }
  172.  
  173.  
  174. fi
  175. rm -f conftest*
  176. done
  177.  
  178. LIBS_save="${LIBS}"
  179. LIBS="${LIBS} -lXbsd"
  180. have_lib=""
  181. echo checking for -lXbsd
  182. cat > conftest.c <<EOF
  183. #include "confdefs.h"
  184.  
  185. int main() { exit(0); }
  186. int t() { main(); }
  187. EOF
  188. if eval $compile; then
  189.   rm -rf conftest*
  190.   have_lib="1"
  191.  
  192. fi
  193. rm -f conftest*
  194. LIBS="${LIBS_save}"
  195. if test -n "${have_lib}"; then
  196.    :; LIBS="$LIBS -lXbsd"
  197. else
  198.    :; 
  199. fi
  200.  
  201. LIBS_save="${LIBS}"
  202. LIBS="${LIBS} -lsocket"
  203. have_lib=""
  204. echo checking for -lsocket
  205. cat > conftest.c <<EOF
  206. #include "confdefs.h"
  207.  
  208. int main() { exit(0); }
  209. int t() { main(); }
  210. EOF
  211. if eval $compile; then
  212.   rm -rf conftest*
  213.   have_lib="1"
  214.  
  215. fi
  216. rm -f conftest*
  217. LIBS="${LIBS_save}"
  218. if test -n "${have_lib}"; then
  219.    :; LIBS="$LIBS -lsocket"
  220. else
  221.    :; 
  222. fi
  223.  
  224. LIBS_save="${LIBS}"
  225. LIBS="${LIBS} -lnsl"
  226. have_lib=""
  227. echo checking for -lnsl
  228. cat > conftest.c <<EOF
  229. #include "confdefs.h"
  230.  
  231. int main() { exit(0); }
  232. int t() { main(); }
  233. EOF
  234. if eval $compile; then
  235.   rm -rf conftest*
  236.   have_lib="1"
  237.  
  238. fi
  239. rm -f conftest*
  240. LIBS="${LIBS_save}"
  241. if test -n "${have_lib}"; then
  242.    :; LIBS="$LIBS -lnsl"
  243. else
  244.    :; 
  245. fi
  246.  
  247. LIBS_save="${LIBS}"
  248. LIBS="${LIBS} -ldl"
  249. have_lib=""
  250. echo checking for -ldl
  251. cat > conftest.c <<EOF
  252. #include "confdefs.h"
  253.  
  254. int main() { exit(0); }
  255. int t() { main(); }
  256. EOF
  257. if eval $compile; then
  258.   rm -rf conftest*
  259.   have_lib="1"
  260.  
  261. fi
  262. rm -f conftest*
  263. LIBS="${LIBS_save}"
  264. if test -n "${have_lib}"; then
  265.    :; LIBS="$LIBS -ldl"
  266. else
  267.    :; 
  268. fi
  269.  
  270.  
  271. STKDIR=..
  272. # check whether --with-STKDIR was given
  273. withval="$with_STKDIR"
  274. if test -n "$withval"; then
  275.   STKDIR=$withval
  276. fi
  277.  
  278.  
  279.  
  280. # Set default prefixes.
  281. if test -n "$prefix"; then
  282.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  283.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  284. fi
  285. if test -n "$exec_prefix"; then
  286.   prsub="$prsub
  287. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
  288. fi
  289. # Quote sed substitution magic chars in DEFS.
  290. cat >conftest.def <<EOF
  291. $DEFS
  292. EOF
  293. escape_ampersand_and_backslash='s%[&\\]%\\&%g'
  294. DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
  295. rm -f conftest.def
  296. # Substitute for predefined variables.
  297.  
  298. trap 'rm -f config.status; exit 1' 1 3 15
  299. echo creating config.status
  300. rm -f config.status
  301. cat > config.status <<EOF
  302. #!/bin/sh
  303. # Generated automatically by configure.
  304. # Run this file to recreate the current configuration.
  305. # This directory was configured as follows,
  306. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  307. #
  308. # $0 $configure_args
  309.  
  310. for arg
  311. do
  312.   case "\$arg" in
  313.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  314.     echo running \${CONFIG_SHELL-/bin/sh} $0 $configure_args
  315.     exec \${CONFIG_SHELL-/bin/sh} $0 $configure_args ;;
  316.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  317.   esac
  318. done
  319.  
  320. trap 'rm -f Makefile; exit 1' 1 3 15
  321. CPP='$CPP'
  322. STKDIR='$STKDIR'
  323. LIBS='$LIBS'
  324. srcdir='$srcdir'
  325. DEFS='$DEFS'
  326. prefix='$prefix'
  327. exec_prefix='$exec_prefix'
  328. prsub='$prsub'
  329. extrasub='$extrasub'
  330. EOF
  331. cat >> config.status <<\EOF
  332.  
  333. top_srcdir=$srcdir
  334.  
  335. CONFIG_FILES=${CONFIG_FILES-"Makefile"}
  336. for file in .. ${CONFIG_FILES}; do if test "x$file" != x..; then
  337.   srcdir=$top_srcdir
  338.   # Remove last slash and all that follows it.  Not all systems have dirname.
  339.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  340.   if test "$dir" != "$file"; then
  341.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  342.     test ! -d $dir && mkdir $dir
  343.   fi
  344.   echo creating $file
  345.   rm -f $file
  346.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  347.   sed -e "
  348. $prsub
  349. $extrasub
  350. s%@CPP@%$CPP%g
  351. s%@STKDIR@%$STKDIR%g
  352. s%@LIBS@%$LIBS%g
  353. s%@srcdir@%$srcdir%g
  354. s%@DEFS@%$DEFS%
  355. " $top_srcdir/${file}.in >> $file
  356. fi; done
  357.  
  358.  
  359. exit 0
  360. EOF
  361. chmod +x config.status
  362. ${CONFIG_SHELL-/bin/sh} config.status
  363.  
  364.  
  365.  
  366.  
  367. BLT=./blt-1.7
  368.  
  369. if test -f $BLT/src/bltDragDrop.c.orig
  370. then
  371.    mv $BLT/src/bltDragDrop.c.orig $BLT/src/bltDragDrop.c
  372. fi
  373. patch < BLT-patch
  374.  
  375. (cd $BLT; configure)
  376.  
  377.